
package com.qdu.dao;

import com.qdu.util.DatabaseUtil;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Lenovo
 */
public class GetManagerDao {

    public List getManager(int admin_id) {
        Connection con = null;
        PreparedStatement ps = null;
        ResultSet rs = null;


        List list = new ArrayList();
        try {
            con = DatabaseUtil.getConnection();
            ps = con.prepareStatement("select * from systemadministrator where admin_id=?");
            ps.setInt(1,admin_id);
            rs = ps.executeQuery();
            rs.next();
            list.add(rs.getString(1));
            list.add(rs.getString(2));
            list.add(rs.getString(3));
            list.add(rs.getString(4));
            return list;
        } catch (Exception e) {
             e.printStackTrace();
            return list;
        } finally {
            DatabaseUtil.close(rs, ps, con);
        }
    }

}
